package com.asr.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

@Data
@Component
@ConfigurationProperties(prefix = "asr")
public class AsrProperties {
    
    private Remote remote;
    private String pythonExecutable = "python3";
    private String scriptPath;
    private String workDir;
    private String audioUploadDir;
    private String outputDir;
    
    private Models models;
    private Default defaultConfig;
    
    @Data
    public static class Remote {
        private Boolean enabled = false;
        private String host;
        private Integer port = 22;
        private String username;
        private String password;
        private String privateKey;
        private String condaEnv;  // Conda 环境名称
        private String condaPath;  // Conda 可执行文件路径
    }
    
    @Data
    public static class Models {
        private Speaker speaker;
        private Map<String, AsrModel> asr;
    }
    
    @Data
    public static class Speaker {
        private String segmentation;
        private String embedding;
    }
    
    @Data
    public static class AsrModel {
        private String type;
        private String model;
        private String tokens;
        private String encoder;
        private String decoder;
    }
    
    @Data
    public static class Default {
        private Integer numSpeakers = -1;
        private Double clusterThreshold = 0.7;
        private String language = "auto";
        private Integer numProcesses = 1;
        private Integer numGpus = 1;
        private Integer numThreads = 2;
        private Integer sampleRate = 16000;
        private String provider = "cuda";
    }
}
